#!/user/bin/env node

const {Transform} = require('stream'),
      chalk = require('chalk'),
      log = console.log;

process.stdin.setEncoding('utf8');

class myTrans extends Transform{
  constructor(){
    super();
  }

  _transform(data,encoding,callback){
    console.log('this:' + this);
    this.push(chalk.yellowBright(data.toString('utf8')));
    callback();
  }

}

process.stdin.pipe(new myTrans()).pipe(process.stdout);
